﻿
@{
    Layout = null;
}

<form id="placeForm" action="/place/" method="post">
    <input id="filterByPlace" placeholder="Pretraga po mestu..." name="place" type="text" />
    <input  type="hidden" value="Pretraga po mestu" />
</form>
<script type="text/javascript">
    $(function () {
        $("#filterByPlace").autocomplete({
            source: "/Event/GetPlaceTitles",
            minLength:2,
            select: function (event, ui) {
                if (ui.item) {
                    $("#filterByPlace").val(ui.item.value);
                    $("#placeForm").submit();
                }
            }
        });
    });
</script>